-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(/guides/basic-rbac): update code examples for Next 15; resolve a few minor issues; update copy #1669
(/guides/basic-rbac): update code examples for Next 15; resolve a few minor issues; update copy #1669
Conversation
Hey, here’s your docs preview: https://clerk.com/docs/pr/1669 |
I think there is an error in the commits after working on my code: I think it should change from |
Good catch. I fixed that. |
|
||
1. Navigate to your `app/admin/page.tsx` file. | ||
1. Replace the code with the following code. | ||
1. Replace the code in your `app/admin/page.tsx` file with the following code. It checks whether a search parameter has been appended to the URL by the search form. If a search parameter is present, it queries for users matching the entered term. If one or more users are found, the component displays a list of users, showing their first and last names, primary email address, and current role. Each user has `Make Admin` and `Make Moderator` buttons, which include hidden inputs for the user ID and role. These buttons use the `setRole()` server action to update the user's role. | ||
|
||
```tsx {{ filename: 'app/admin/page.tsx' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share your tsconfig and I can take a look into this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed a commit that resolves this on my end. Let me know if you're still seeing errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah it still gives me those type errors, but if you are saying you don't have the type errors then it should be fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share your repo? The errors should be gone. There is either something in your repo (and maybe still in this code that I didn't update) or there is something that is suppressing the errors in my editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is this repo: aa-clerk-next-app
but I made a repo based off of our updated demo repo, and it works with no errors https://github.com/alexisintech/aa-clerk-nextjs-demo2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so I wouldn't worry about it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also got the same errors. After I wrapped the form actions in async
and await
the functions, everything works.
I think this is good to go whenever! @royanger |
Co-authored-by: victoria <[email protected]>
Important
🔎 Previews:
DOCS-9468
Explanation:
Updated the code examples to be consistent and work with Next 15 and @clerk/nextjs v6